package com.xinzhi.controller;


import com.xinzhi.domain.User;
import com.xinzhi.domain.vo.LoginVo;
import com.xinzhi.service.LoginService;
import com.xinzhi.service.UserService;
import com.xinzhi.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping
public class logincontroller {
@Autowired
private LoginService loginService;
    @Autowired
    private UserService userService;
    @RequestMapping("login")
    public Result login(@RequestBody LoginVo loginVo){
        // 登录 验证用户 访问用户表
      return  loginService.login(loginVo);
    }

    @RequestMapping("/register")
    public Result rig(@RequestBody User user){
        // 登录 验证用户 访问用户表
        return userService.telReg(user);
    }

}
